package service

import (
	"context"

	"gitee.com/thewalkers/refactoring-code/model"
)

// PaymentMethodService acts as a struct for injecting an implementation of EmployeeRepository
// for use in service methods
type PaymentMethodService struct {
	PaymentMethodRepository model.PaymentMethodRepository
}

// PMConfig will hold repository that will eventually be injected into this
// service layer
type PMConfig struct {
	PaymentMethodRepository model.PaymentMethodRepository
}

// NewPaymentMethodService is a factory function for
// initializing a EmployeeService with its repository layer dependencies
func NewPaymentMethodService(c *PMConfig) model.PaymentMethodService {
	return &PaymentMethodService{
		PaymentMethodRepository: c.PaymentMethodRepository,
	}
}

func (p *PaymentMethodService) Create(ctx context.Context, paymentSchdule *model.PaymentMethod) error {
	return p.PaymentMethodRepository.Create(ctx, paymentSchdule)
}
